<!DOCTYPE html>
<html lang="zh">
<head>
    <meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
    <!--<meta charset="UTF-8">-->
    <title>Hello World</title>
    <meta name="viewport" content="width=device-width"/>
    <script type="text/javascript" src="js/jquery-3.3.1.min.js"></script>
    <script type="text/javascript">

        $('document').ready(function () {
            var url = 'server.php?request_code=1';
            var data = {};

            $.getJSON(url, data, function (result) {
                $('#username').val(result.arr[0].username);
                $('#age').val(result.arr[0].age);
                $('#email').val(result.arr[0].email);
                $('#create_time').val(result.arr[0].create_time);
                $('#id_delete').val(result.arr[0].id)
                $('#id_update').val(result.arr[0].id)
            });
        })

    </script>

</head>

<h1>Hello world!</h1>

<form action="server.php?request_code=2" method="post">

    <br>user name:<input type="text" name="username" id="username">
    <br>age:<input type="text" name="age" id="age">
    <br>email:<input type="text" name="email" id="email">
    <br>create time:<input type="text" name="create_time" id="create_time">
    <input type="submit" name="submit" value="添加该项">
</form>

<!--哈哈哈，同道中人;)-->
<!--测试用数据库，不要删光了呀。-->
<!--<form action="server.php?request_code=3" method="post">-->
    <!--<br>id:<input type="text" name="id" id="id_delete">-->
    <!--<input type="submit" value="删除此项">-->
<!--</form>-->

<form action="server.php?request_code=4" method="post">
    <br>user name:<input type="text" name="username" >
    <br>age:<input type="text" name="age" >
    <br>email:<input type="text" name="email" >
    <br>id:<input type="text" name="id" id="id_update">
    <input type="submit" value="更新此项">
</form>
<br>

</body>
</html>